<?php
/**
 * Created by PhpStorm.
 * User: 12133
 * Date: 2024/10/12
 * Time: 14:15
 */

namespace app\controller\index;
use app\model\UserAmount AS model;
use app\model\index\User AS user;
class Amount extends Base
{
    public function list(){
        $user_id = user::where('pid',$this->user->id)->select();
        if(!empty($user_id))
            $user_id = array_merge([
                $this->user->id
            ],
                array_column($user_id->toArray(),'id')
            );
        else
            $user_id = [$this->user->id];
        $list = model::where('user_id','IN',$user_id)
            ->paginate(['page' => $this->page,'list_rows' => $this->size]);
        return $this->view('/index/amount/list',['list' => $list]);
    }
}